﻿using Airborne.ScrumPoker.Model.Cards;
using Airborne.ScrumPoker.Module.ProductOwner.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Airborne.ScrumPoker.Module.ProductOwner.Tests.Model
{
    [TestClass]
    public class PlayerTestFixture
    {
        [TestMethod]
        public void VotedTest()
        {
            Player client = new Player();
            Assert.IsFalse(client.Voted);
            client.Vote = new SimpleCard() { ActualValue = 10 };
            Assert.IsTrue(client.Voted);
        }

        [TestMethod]
        public void ResetTest()
        {
            Player client = new Player();
            client.ClientName = "jack";
            client.Vote = new SimpleCard() { ActualValue = 10 };
            client.VoteShown = true;

            Assert.AreEqual("jack", client.ClientName);
            Assert.AreEqual(10, client.Vote.ActualValue);
            Assert.IsTrue(client.Voted);
            Assert.IsTrue(client.VoteShown);

            client.Reset();

            Assert.AreEqual("jack", client.ClientName);
            Assert.IsNull( client.Vote);
            Assert.IsFalse(client.Voted);
            Assert.IsFalse(client.VoteShown);

        }
    }
}
